package interviewpreparationkit.dictionary

import redirectSystemIn
import redirectSystemOut
import org.junit.jupiter.api.Test
import java.util.*

class CheckMagazineTests {
    @Test
    fun checkMagazineTest() {
        redirectSystemIn(this.javaClass) {
            val scan = Scanner(System.`in`)

            redirectSystemOut {
                while (scan.hasNextLine()) {
                    val mn = scan.nextLine().split(" ")

                    val m = mn[0].trim().toInt()

                    val n = mn[1].trim().toInt()

                    val magazine = scan.nextLine().split(" ").toTypedArray()

                    val note = scan.nextLine().split(" ").toTypedArray()

                    checkMagazine(magazine, note)

                    it.add(scan.nextLine().trim())
                }
            }
        }
    }
}